home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 214 / 214.d81 / t.tiny grafix < prev    next >
Text File  |  2022-08-26  |  4KB  |  171 lines

  1. u
  2.              TINY GRAFIX
  3.            by Dave Moorman
  4.  
  5.  
  6.     The goal is to make a "true" morph
  7. program, when images proportionally
  8. shift one to another. Doing this on a
  9. full bitmap screen would be a long and
  10. tedious process -- not to mention
  11. using huge amounts of disk space.
  12.  
  13.     So, in preparation, I developed
  14. Tiny Grafix, a small, text/font bitmap
  15. that can be placed anywhere on a text
  16. screen. Actually, the Tiny screen can
  17. be 96 x 80 or 152 x 80 pixels in size.
  18. In both sizes, the unshifted text
  19. letters are still available. With a 96
  20. x 80 screen, you can have both upper
  21. and lower case text.
  22.  
  23.     While I was at it, I decided to
  24. try to create a self-running data
  25. file. That is to say, if you bload the
  26. file to page 64, then a SYS64*256
  27. (plus parameters) will display the
  28. graphic. This requires fully
  29. relocateable ML code.
  30.  
  31.     Don't gasp! Long ago, Jeff Jones
  32. explained that relocatable code is
  33. possible as long as you:
  34.  
  35.     1. Use Branches instead of Jumps
  36.     2. Never use JSRs (or JMPs) to
  37.        locations inside the program.
  38.     3. Never load from locations
  39.        inside the program.
  40.  
  41.     And that would be all fine and
  42. dandy -- except Subroutines are [so]
  43. convenient! Reading the parameters
  44. without subroutines would be sloppy
  45. coding.
  46.  
  47.     However, I [can] JSR outside the
  48. code. And when the program does a JSR,
  49. the return memory location is stuffed
  50. in the processor stack. And, YES! I
  51. can get the index pointer to the stack
  52. (TSX), and retrieve the location of
  53. the program.
  54.  
  55.     Then for each label in the program
  56. that marks a subroutine, the set-up
  57. code creates a jump vector (in the
  58. casette buffer). The overhead for
  59. doing this is about 24 bytes for each
  60. subroutine label.
  61.  
  62.  
  63.  [USING TINY GRAFIX]
  64.  
  65.     But enough bragz. A Tiny Grafix
  66. file must be created with Tiny Maker,
  67. using any high-res bitmap in SHP
  68. format. A good trick is to use DOODLE!
  69. to shrink a full screen to the 96 x 80
  70. or 152 x 80 size. For full
  71. documentation of Tiny Maker, see the
  72. program on this issue.
  73.  
  74.     However, I have included several
  75. Tiny Grafix files (they have the .TINY
  76. extension) on this issue for you to
  77. play with. You must bload the file
  78. into any free, open memory (not under
  79. ROM or I/O). Each file is exactly 2048
  80. bytes -- 8 pages.
  81.  
  82.  SYS57812"tiny1.tiny",d,0:pO780,0:
  83.  pO781,0:pO782,pg:sys65493
  84.  
  85.  where "d" is the drive
  86.  and "pg" is the memory page
  87.  
  88.     You must be using a custom font.
  89.  
  90.     To display the Tiny Graphic, use
  91. the following command:
  92.  
  93.  SYSpg*256,x,y,fpg,mode
  94.  
  95.  where
  96.  
  97.  pg is the memory page where the file
  98.     starts,
  99.  
  100.  x is the text column and
  101.  
  102.  y is the text row of the upper left
  103.     corner of the graphic
  104.  
  105.  fpg is the memory page of your custom
  106.     font.
  107.  
  108.  mode is your choice of actions:
  109.  
  110.     0 Clear graphic area of font, put
  111.       on screen, copy Tiny Grafic.
  112.  
  113.     1 Clear Screen, then do mode 0.
  114.  
  115.     2 Copy Tiny Grafic (must do mode 0
  116.       1 or 3 first).
  117.  
  118.     3 Clear graphic area of font, put
  119.       on screen.
  120.  
  121.  
  122.     I had a few bytes left in the
  123. file, so I added a small plot routine.
  124. You MUST use the above command first!
  125. (It makes the jump vector table.)
  126. Besides, you will want to do a mode 3
  127. at least to put the Tiny bitmap on the
  128. screen.
  129.  
  130.  sys pg+3,x,y,fpg,mode
  131.  
  132.  where x is the pixel column and
  133.  
  134.        y is the pixel row.
  135.  
  136.        fpg is the page of your custom
  137.            font.
  138.  
  139.        mode is:
  140.  
  141.          0 pixel off
  142.          1 pixel on
  143.          3 pixel toggled
  144.          4 look at pixel
  145.  
  146.     In mode 4, PEEK(780) will return
  147. 0 if the pixel is off and 1 if the
  148. pixel is on.
  149.  
  150.     That's the basics. Stay tuned,
  151. LOADSTARites! Next month will bring a
  152. fairly complete "stationary" drawing
  153. package for the Tiny Grafix screen.
  154.  
  155.     By the way, this screen is
  156. designed the way demo dudes do their
  157. great sinus plots. The characters are
  158. stacked 10 high. The Y coordinate is
  159. easy -- put it in .Y! For the X coord,
  160. the program does AND#%11111000 (then
  161. multiplies the result by 10), and
  162. AND#%00000111 (to index the pixel
  163. within the byte).
  164.  
  165.     That's it for now. Stay tuned,
  166. LOADSTARites. A full feature graphics
  167. package for Tiny Grafix is on the way!
  168.  
  169.  DMM
  170.  
  171.  
  172.